import React, { Component } from 'react'
import {Switch, Route} from 'react-router-dom'
import MyNavLink from '../../components/MyNavLink'
import News from "./News"
import Message from "./Message"
import "./index.css"

export default class Home extends Component {
  render() {
    return (
      <div>
        Home组件内容
        <div className="home-nav-box">
          <MyNavLink to="/home/news">News</MyNavLink>
          <MyNavLink to="/home/message">Message</MyNavLink>
        </div>
        {/* 注册路由 */}
        <Switch>
          <Route path="/home/news" component={News}/>
          <Route path="/home/message" component={Message}/>
        </Switch>
      </div>
    )
  }
}
